package com.ll.core.util;

import java.text.SimpleDateFormat;
import java.util.Date;

public class CommonTool {

	public static String DateToString(long dm, String format) {
		Date date = new Date();
		date.setTime(dm);
		return DateToString(date, format);
	}

	public static String DateToString(Date date, String format) {
		String defaultFormat = format;
		if (defaultFormat == null) {
			defaultFormat = "yyyy-MM-dd";
		}
		SimpleDateFormat sdf = new SimpleDateFormat(defaultFormat);
		return sdf.format(date);
	}
	
	

}
